<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Submenu_model extends CI_Model {

	public function get_list(){
		$this->db->join('mainmenu b','a.id_main = b.id_main','left');
		return $this->db->get('submenu a');
	}

	public function do_add($param = false){
		if($param){
			return $this->db->insert('submenu',$param);
		}
		return false;
	}

	public function do_update($id = false,$param = false){
		if($id){
			$this->db->where('id_sub',$id);
			return $this->db->update('submenu',$param);
		}
		return false;
	}

	public function do_delete($id = false){
		if($id){
			$this->db->where('id_sub',$id);
			return $this->db->delete('submenu');
		}return false;
	}
}